home *** CD-ROM | disk | FTP | other *** search
- //does lookup into env map and (maybee blends with another given color?)
-
- //color of sky
- float4 skyClr;
-
- //texture blob and env map
- sampler sampBlob;
- sampler sampCube;
-
- //input
- struct PS_INPUT
- {
- float2 Tex : TEXCOORD0;
- float3 Env : TEXCOORD1;
- };
-
- //shader code
- float4 PShader(PS_INPUT In) : COLOR
- {
- In.Env=normalize(In.Env);
-
- //sample env map and texture
- float4 eClr=texCUBE(sampCube,In.Env);
- if (In.Env.z<0)
- {
- float4 water=float4(0.2f,0.15,0.55,0.55f);
- eClr=lerp(eClr,water,saturate(-In.Env.z*20.0f));
- }
- float4 tClr=tex2D(sampBlob,In.Tex);
-
- float3 blueClr=float3(0,0,1);
-
- //blend
- float4 clr;
- clr.xyz=0.425f*eClr.xyz + 0.4f*skyClr.xyz + 0.125f*blueClr;
- clr.a=tClr.a*eClr.a;
-
- return clr;
- }
-